package com.dougmccune.charts.gantt.skins
{
	import mx.skins.Border;
	import flash.geom.Matrix;
	import flash.display.GradientType;

/**
 *  The skin for the highlighted state of the track of a Slider.
 */
public class GanttSliderHighlightSkin2 extends Border
{
	
	//--------------------------------------------------------------------------
	//
	//  Constructor
	//
	//--------------------------------------------------------------------------

    /**
	 *  Constructor.
	 */
	public function GanttSliderHighlightSkin2()
	{
		super();
	}


	//--------------------------------------------------------------------------
	//
	//  Overridden methods
	//
	//--------------------------------------------------------------------------
	
    /**
	 *  @private
	 */
	override protected function updateDisplayList(w:Number, h:Number):void
	{
		super.updateDisplayList(w, h);
		
		var themeColor:int = getStyle("completeColor");
		
		graphics.clear();
		
		var colors:Array = new Array(themeColor, themeColor);
        
        var m:Matrix = new Matrix();
        var scaleX:Number = w;
        var scaleY:Number = h/2;
        var r:Number = Math.PI / 2;
        var tX:Number = 0;
        var tY:Number = 0;
        m.createGradientBox(scaleX, scaleY, r, tX, tY);
        
        graphics.beginFill(themeColor, 1);
        graphics.drawRoundRect(0, 0, w, h, 5);
			
		graphics.beginGradientFill(GradientType.LINEAR, [0xffffff, 0xffffff], [.05, .1], [0, 255], m);
        graphics.drawRoundRect(0, 0, w, h/2, 5);
        
        m.createGradientBox(scaleX, scaleY, r, tX, h/2);
        graphics.beginGradientFill(GradientType.LINEAR, [0x000000, 0x000000], [.1, .4], [125, 255], m);
        graphics.drawRoundRect(0, h/2, w, h/2, 5);
		
		graphics.endFill();
		
		
	}
}
}